package com.gwq.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gwq.entity.User;
import com.gwq.mapper.UserMapper;
import com.gwq.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【user(测试用户表)】的数据库操作Service实现
 * @createDate 2024-07-25 14:18:13
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @DS("slaver")
    @Override
    public List<User> selectAllUser() {
        List<User> userList = getBaseMapper().selectList(null);
        return userList;
    }

    @DS("master")
    @Override
    public void saveUser(User user) {
        save(user);
    }
}




